package de.wesemann.jdedun.entities.calendar.events;

import de.wesemann.jdedun.entities.AbstractEntity;

public class CalendarEvent extends AbstractEntity {

    private int category_id;
    private int host_id;
    private int venue_id;
    private String date_from;
    private String time_from;
    private String date_to;
    private String time_to;
    private String name;
    private String description;
    private String url;

    /**
     * Gibt die id der Branche des Termins an (nur Branchen mit internal_type
     * sub_market sind erlaubt)
     * 
     * @return the category_id
     */
    public int getCategory_id() {
	return category_id;
    }

    /**
     * Gibt die id der Branche des Termins an (nur Branchen mit internal_type
     * sub_market sind erlaubt)
     * 
     * @param category_id
     *            the category_id to set
     */
    public void setCategory_id(int category_id) {
	this.category_id = category_id;
    }

    /**
     * Gibt die id des Veranstalters des Termins an
     * 
     * @return the host_id
     */
    public int getHost_id() {
	return host_id;
    }

    /**
     * Gibt die id des Veranstalters des Termins an
     * 
     * @param host_id
     *            the host_id to set
     */
    public void setHost_id(int host_id) {
	this.host_id = host_id;
    }

    /**
     * Gibt die id des Veranstaltungsortes an, in welchen der Termin stattfindet
     * 
     * @return the venue_id
     */
    public int getVenue_id() {
	return venue_id;
    }

    /**
     * Gibt die id des Veranstaltungsortes an, in welchen der Termin stattfindet
     * 
     * @param venue_id
     *            the venue_id to set
     */
    public void setVenue_id(int venue_id) {
	this.venue_id = venue_id;
    }

    /**
     * Datum des Beginns (Format jjjj-mm-tt, z.B. “2011-03-12”
     * 
     * @return the date_from
     */
    public String getDate_from() {
	return date_from;
    }

    /**
     * Datum des Beginns (Format jjjj-mm-tt, z.B. “2011-03-12”
     * 
     * @param date_from
     *            the date_from to set
     */
    public void setDate_from(String date_from) {
	this.date_from = date_from;
    }

    /**
     * Startzeit (Format SS:MM:SS, z.B. “12:59:48”
     * 
     * @return the time_from
     */
    public String getTime_from() {
	return time_from;
    }

    /**
     * Startzeit (Format SS:MM:SS, z.B. “12:59:48”
     * 
     * @param time_from
     *            the time_from to set
     */
    public void setTime_from(String time_from) {
	this.time_from = time_from;
    }

    /**
     * Datum des Endes (bei mehrtägigen Veranstaltungen) (Format jjjj-mm-tt,
     * z.B. “2011-03-14”
     * 
     * @return the date_to
     */
    public String getDate_to() {
	return date_to;
    }

    /**
     * Datum des Endes (bei mehrtägigen Veranstaltungen) (Format jjjj-mm-tt,
     * z.B. “2011-03-14”
     * 
     * @param date_to
     *            the date_to to set
     */
    public void setDate_to(String date_to) {
	this.date_to = date_to;
    }

    /**
     * Endzeit (Format SS:MM:SS, z.B. “15:59:48”
     * 
     * @return the time_to
     */
    public String getTime_to() {
	return time_to;
    }

    /**
     * Endzeit (Format SS:MM:SS, z.B. “15:59:48”
     * 
     * @param time_to
     *            the time_to to set
     */
    public void setTime_to(String time_to) {
	this.time_to = time_to;
    }

    /**
     * Name des Termins
     * 
     * @return the name
     */
    public String getName() {
	return name;
    }

    /**
     * Name des Termins
     * 
     * @param name
     *            the name to set
     */
    public void setName(String name) {
	this.name = name;
    }

    /**
     * Beschreibung des Termins
     * 
     * @return the description
     */
    public String getDescription() {
	return description;
    }

    /**
     * Beschreibung des Termins
     * 
     * @param description
     *            the description to set
     */
    public void setDescription(String description) {
	this.description = description;
    }

    /**
     * Link zu einer Website mit näheren Informationen (Internetadresse
     * beginnend mit http://)
     * 
     * @return the url
     */
    public String getUrl() {
	return url;
    }

    /**
     * Link zu einer Website mit näheren Informationen (Internetadresse
     * beginnend mit http://)
     * 
     * @param url
     *            the url to set
     */
    public void setUrl(String url) {
	this.url = url;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#hashCode()
     */
    @Override
    public int hashCode() {
	final int prime = 31;
	int result = super.hashCode();
	result = prime * result + category_id;
	result = prime * result
		+ ((date_from == null) ? 0 : date_from.hashCode());
	result = prime * result + ((date_to == null) ? 0 : date_to.hashCode());
	result = prime * result
		+ ((description == null) ? 0 : description.hashCode());
	result = prime * result + host_id;
	result = prime * result + ((name == null) ? 0 : name.hashCode());
	result = prime * result
		+ ((time_from == null) ? 0 : time_from.hashCode());
	result = prime * result + ((time_to == null) ? 0 : time_to.hashCode());
	result = prime * result + ((url == null) ? 0 : url.hashCode());
	result = prime * result + venue_id;
	return result;
    }

    /* (non-Javadoc)
     * @see java.lang.Object#equals(java.lang.Object)
     */
    @Override
    public boolean equals(Object obj) {
	if (this == obj) {
	    return true;
	}
	if (!super.equals(obj)) {
	    return false;
	}
	if (getClass() != obj.getClass()) {
	    return false;
	}
	CalendarEvent other = (CalendarEvent) obj;
	if (category_id != other.category_id) {
	    return false;
	}
	if (date_from == null) {
	    if (other.date_from != null) {
		return false;
	    }
	} else if (!date_from.equals(other.date_from)) {
	    return false;
	}
	if (date_to == null) {
	    if (other.date_to != null) {
		return false;
	    }
	} else if (!date_to.equals(other.date_to)) {
	    return false;
	}
	if (description == null) {
	    if (other.description != null) {
		return false;
	    }
	} else if (!description.equals(other.description)) {
	    return false;
	}
	if (host_id != other.host_id) {
	    return false;
	}
	if (name == null) {
	    if (other.name != null) {
		return false;
	    }
	} else if (!name.equals(other.name)) {
	    return false;
	}
	if (time_from == null) {
	    if (other.time_from != null) {
		return false;
	    }
	} else if (!time_from.equals(other.time_from)) {
	    return false;
	}
	if (time_to == null) {
	    if (other.time_to != null) {
		return false;
	    }
	} else if (!time_to.equals(other.time_to)) {
	    return false;
	}
	if (url == null) {
	    if (other.url != null) {
		return false;
	    }
	} else if (!url.equals(other.url)) {
	    return false;
	}
	if (venue_id != other.venue_id) {
	    return false;
	}
	return true;
    }

    /*
     * (non-Javadoc)
     * 
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
	StringBuilder builder = new StringBuilder();
	builder.append("CalendarEvent [category_id=").append(category_id)
		.append(", host_id=").append(host_id).append(", venue_id=")
		.append(venue_id).append(", date_from=").append(date_from)
		.append(", time_from=").append(time_from).append(", date_to=")
		.append(date_to).append(", time_to=").append(time_to)
		.append(", name=").append(name).append(", description=")
		.append(description).append(", url=").append(url).append("]").append(super.toString());
	return builder.toString();
    }

}
